package _22define;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class Demo {
    public static void main(String[] args) throws IOException {
        FileInputStream in=new FileInputStream("src/note/a.txt");
        byte[] bytes=new byte[4];
        int readCount= in.read(bytes,2,3);
        System.out.println("readCount="+readCount);
        in.close();

    }
    private static void readMultiByte(FileInputStream in) throws IOException {
        byte[] bytes = new byte[1024];
        int readCount = in.read(bytes);
        System.out.println("readCount = " + readCount);
        // byte[]---->String
        String s = new String(bytes);
        System.out.println("s = " + s);
    }

    private static void readSingleByte(FileInputStream in) throws IOException {
        int readCount1 = in.read();
        System.out.println(readCount1);
        int readCount2 = in.read();
        System.out.println(readCount2);

        int readCount3 = in.read();
        System.out.println(readCount3);

        int readCount4 = in.read();
        System.out.println(readCount4);
    }
}
